import { configureStore } from '@reduxjs/toolkit'

import appSlice from './slice'
const { setLang } = appSlice.actions
const store = configureStore({
  reducer: {
    app: appSlice.reducer,
  },
})
export default store

export { setLang }
// dispatch的新类型,可以传入异步action
export type AppDispatch = typeof store.dispatch
// 定义当前redux中存储的数据的类型
export type RootState = ReturnType<typeof store.getState>
